/*
 * nativeimage_ImageTools.cpp
 *
 *  Created on: 2017年9月8日
 *      Author: niuhuan
 */

#include "nativeimage_ImageTools.h"

#include <jni.h>

#include "jnihelper.h"

#include <SDL/SDL_image.h>

#include "l_jpeg.h"


JNIEXPORT jboolean JNICALL Java_nativeimg_ImageTools_zoomJpeg
  (JNIEnv* env, jobject jobj, jstring jsrc, jstring jtarget, jint jmaxWidth, jint jmaxHeight,jint jquality){

	char* sourcePath = jstringTostring(env, jsrc);
	char* targetPath = jstringTostring(env, jtarget);

	const char* cs = sourcePath;
	const char* ct = targetPath;
	int maxWidth= jmaxWidth;
	int maxHeight = jmaxHeight;
	int quality = 80;

	return generate_image_thumbnail(cs,ct,maxWidth,maxHeight,quality);
}

